package com.wish.controller;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wish.dto.CheckBatchDto;
import com.wish.entity.TCwCheckBatch;
import com.wish.service.ITCwCheckBatchService;
import com.wish.vo.ResultEntity;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 对账批次表 前端控制器
 * </p>
 *
 * @author 五组
 * @since 2021-04-08
 */
@RestController
@RequestMapping("/wish/t-cw-check-batch")
@Slf4j
public class TCwCheckBatchController {
    @Resource
    private ITCwCheckBatchService checkBatchService;

    @RequestMapping("selects")
    public ResultEntity selects(CheckBatchDto checkBatchDto){
        PageHelper.startPage(checkBatchDto.getPageNum(),checkBatchDto.getPageSize());
        List<TCwCheckBatch> list = checkBatchService.selects(checkBatchDto);
        PageInfo<TCwCheckBatch> info = new PageInfo<>(list);
        return ResultEntity.ok("200","查询成功",info);
    }
    @RequestMapping("getOne")
    public TCwCheckBatch getOne(String batchNo){
        return checkBatchService.getOne(batchNo);
    }

}
